/*
 *--------------------------------------------------------------------------
 *   Battlefield - A Realtime Network Multiplayer Game
 *   =======================================================
 *   Developed by Group D02 - 2009/2010 Semester 4 - CS2103
 *     Harry Nguyen Duy Hoang <nnduyhoang@yahoo.co.uk>
 *     Kent Chng Siang Rong <fivefootway@gmail.com>
 *     Lim Yong Peng <limpeng1986@gmail.com>
 *     Loh Xiankun <u0807185@nus.edu.sg>
 *   Instructed by
 *     Dr. Damith C.Rajapakse <damith@gmail.com>
 *   =======================================================
 *   $Id: ComponentDecorator.java 642 2010-07-30 05:56:22Z Harry $
 *   $LastChangedDate: 2010-07-30 05:56:22 +0000 (Fri, 30 Jul 2010) $
 *   $LastChangedBy: Harry $
 *--------------------------------------------------------------------------
 */
package battlefield.util;

import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JLabel;
import javax.swing.JTextField;

/**
 *
 * @author Yong Peng
 */
public class ComponentDecorator {

    private static int fontSize = 14;

    public static JLabel decorateLabel(JLabel label, String text) {
        label = new JLabel(text);
        label.setForeground(Color.white);
        label.setFont(new java.awt.Font("Century Gothic", 0, fontSize));
        return label;
    }

    public static JTextField decorateTextfield(JTextField textField, int fieldLimit, String text) {
        textField = new JTextField();
        textField.setDocument(new JTextFieldLimit(fieldLimit));
        textField.setText(text);
        textField.setFont(new java.awt.Font("Century Gothic", 0, fontSize));
        textField.setPreferredSize(new Dimension(125, 35));
        return textField;
    }
}
